/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CSISL4pk;


import javax.swing.*;
import java.awt.*;
import java.sql.*;
/**
 *
 * @author Josh
 */
public class LoginGUI  extends JInternalFrame{
    static int openFrameCount = 0;
    static final int xOffset = 10, yOffset = 10;
    
    Boolean iN;//login true or false
    public ResultSet rs;
    public String qName;
    public String pName;
    public String uName;
    public String pWd;
    
    //initialize components
    JPanel loginPane = new JPanel();
    JLabel welcomeName = new JLabel();
    JTextField uNameTextField = new JTextField();
    JTextField pWrdTextField = new JTextField();
    JButton enterButton = new JButton();
    JLabel uNameL = new JLabel();
    JLabel pWrdL = new JLabel();
    
    public LoginGUI() {
        super("Login #" + (++openFrameCount), 
              false, //resizable
              true, //closable
              false, //maximizable
              true);//iconifiable
        
        //...Create the GUI and put it in the window...
        
        add(loginPane);
        loginPane.setLayout(null);
        //Welcome Label
        setContentPane(loginPane);
        welcomeName.setText("Welcome");
        welcomeName.setFont(new Font("SansSerif", Font.BOLD, 14));
        welcomeName.setBounds(20,20,120,15);
        loginPane.add(welcomeName);
        
        JLabel cs = new JLabel();
        cs.setText("CSI - Salt Lake");
        cs.setFont(new Font("SansSerif", Font.BOLD, 18));
        cs.setBounds(360,20,150,15);
        loginPane.add(cs);
        
        uNameL.setText("Username:");
        uNameL.setBounds(50,60,100,25);
        loginPane.add(uNameL);
        
        pWrdL.setText("Password:");
        pWrdL.setBounds(50,95,100,25);
        loginPane.add(pWrdL);
        
        uNameTextField.setBounds(120, 60, 180, 30);
        loginPane.add(uNameTextField);
        
        pWrdTextField.setBounds(120, 95, 180, 30);
        loginPane.add(pWrdTextField);
        
        enterButton.setBounds(320, 90, 150, 35);
        //enterButton.setActionCommand("submit");
        //enterButton.addActionListener(enterButton.getAction());
        enterButton.setText("Submit");
        //enterButton.addActionListener(this);
        loginPane.add(enterButton);
        
        //return loginPane;
        //...Then set the window size or call pack...
        setSize(550,200);//size of window
        
        //Set the window's location.
        setLocation(400, 200);
    }

}
